{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-06-19T06:49:54.719041Z",
     "start_time": "2020-06-19T06:49:54.713609Z"
    }
   },
   "outputs": [],
   "source": [
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-06-19T06:50:06.706472Z",
     "start_time": "2020-06-19T06:50:06.693790Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['.ipynb_checkpoints',\n",
       " '01-Keras神经网络入门.ipynb',\n",
       " '02-keras_advanced.py',\n",
       " '24-notMNIST图像分类.ipynb',\n",
       " '25-CNN图像分类.ipynb',\n",
       " '25-基于词向量和LSTM对豆瓣影评分类.ipynb',\n",
       " '26-RNN原理及使用(PyTorch) .ipynb',\n",
       " '26-恶意评论分类.ipynb',\n",
       " '27-CNN及迁移学习图像分类.ipynb',\n",
       " '27-基于RNN的影评情感分类(PyTorch).ipynb',\n",
       " '32-经典CNN架构实现(TensorFlow).ipynb',\n",
       " '33-autoencoders.ipynb',\n",
       " '34-GANs.ipynb',\n",
       " '35-style_transfer.ipynb',\n",
       " '36-卷积神经网络的可视化.ipynb',\n",
       " '37-时间序列预测.ipynb',\n",
       " '未命名.ipynb']"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sorted(os.listdir('.'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-06-19T06:57:12.376139Z",
     "start_time": "2020-06-19T06:57:12.369791Z"
    }
   },
   "outputs": [],
   "source": [
    "for i, file in enumerate(sorted(os.listdir('.'))):\n",
    "    parts = file.split('-')\n",
    "    if len(parts) == 2:\n",
    "        idx, name = parts\n",
    "        if idx.isdigit():\n",
    "            new_idx = str(i) if i > 9 else \"0\" + str(i)\n",
    "            dst = new_idx + \"-\" + name\n",
    "            os.rename(file, dst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(\"README.md\", 'w') as f:\n",
    "    for file in sorted(os.listdir('.')):\n",
    "        name = file.split('.')[0]\n",
    "        string = f\"[{name}]({'./'+file})\"\n",
    "        \n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
